move PusherPing off the durable write queue - #97702
Open
adhorodyski wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f89d16e97b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The no-multiple-api-calls rule counts `API` tokens per function body, so the third assertion pushed the describe block over the limit. One module-scope mockAPI handle keeps the count at zero inside functions. Drop the pingID shape assertion too: pingPusher builds a typed PusherPingParams, so tsc already guarantees it is a string. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
adhorodyski
marked this pull request as ready for review
August 3, 2026 17:30
melvin-bot
Bot
requested review from
inimaga and
trjExpensify
and removed request for
a team
August 3, 2026 17:30
Contributor
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2026-08-04.at.01.01.03.mov |
DylanDylann
reviewed
Aug 3, 2026
Contributor
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
trjExpensify
removed their request for review
August 3, 2026 22:44
The test advanced no timers, so it only passed because the two watchdog tests ahead of it had already run the 30s ping interval and the mock was never cleared. Run alone it saw zero calls. Clearing the mock and advancing one ping interval makes it independent of test order. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
PusherPingis a 30 second heartbeat that checks the Pusher event path. The client posts a ping over HTTP and the server answers with aPONGover the websocket.It was sent with
API.write, so it was written to disk every 30 seconds, retried up to 10 times with doubling backoff, and could hold the head of the single-flight queue while a real write waited behind it. In a 4 hour window it was the most retried command in the app: 5,075 attempts across 2,924 users, against 1,135 for the next command.This moves
PUSHER_PINGtoSIDE_EFFECT_REQUEST_COMMANDSand sends it withAPI.makeRequestWithSideEffects. That path is not persisted, not retried, and does not touch the queue.API.readwaits for the write queue to drain first, which is the coupling being removed.The probe stays.
checkForLatePongRepliescallsPusher.reconnect()when aPONGgoes missing, which shipped in #96883.Fixed Issues
$ #97712
PROPOSAL:
Tests
tests/unit/PusherPingPongTest.ts: the existing watchdog tests needed a mock fix, because the automocked@libs/APIreturnsundefinedandpingPushernow chains a.catchon the returned promise. Added one assertion that the ping goes out throughmakeRequestWithSideEffectswithPusherPingand that the old write path is not called. Verified it fails against the old call and passes against the new one.Also ran
tests/unit/APITest.ts,tests/unit/SequentialQueueTest.ts,tests/unit/NetworkTest.tsxandtests/unit/RequestTest.ts. All pass.Manual check for a reviewer: sign in, wait a minute, and confirm the
[Pusher PINGPONG] Received a PONG event from the serverlog still arrives and thatPusherPingno longer appears inPERSISTED_REQUESTS.Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari